import React ,{Component}from 'react'

//css
import "./index.scss"
//组件
import LoginForm from './component/LoginForm'
import RegisterForm from './component/RegisterForm'

class Login extends Component{
    constructor(){
        super();
        this.state = {
            formType:'login'
        };
        // this.onFinish = this.onFinish.bind(this);
    }
    // onFinish(){
    //
    // };
      switchForm = (value) =>{
          this.setState(
              {
                  formType:value
              }
          )
      }
    render(){

        return (
            <div className="form-wrap">
                <div>
                    {this.state.formType === 'login'?
                        <LoginForm changeView={this.switchForm}/>: <RegisterForm changeView={this.switchForm}/>}

                </div>
            </div>
        )
    }
}

export default Login
